import { useLocation } from 'react-router-dom'
import { useEffect } from 'react'

function useQuery () {
	return new URLSearchParams(useLocation().search)
}

function useOnEnter (callback) {
	const { pathname } = useLocation()
	useEffect(callback, [pathname])
}

export {
	useQuery,
	useOnEnter
}